<html>
<head>
<script type="text/javascript" src="../js/splender.js"></script>
<script type="text/javascript">
var oblivion_splender_theme = {
    "use_css_classes" : true,
    'k' : "keyword", 
    'c' : "comment",
    's' : "string",
    'h' : "char"
};
</script>
<style type="text/css">
pre.oblivion_splender_theme {
    display: block;
    border-style: solid;
    border-color: #111;
    border-width: 1px 1px 1px 10px;
    background: #333;
    padding: 7px;
}
pre.oblivion_splender_theme              { color: #eee; }
pre.oblivion_splender_theme span.keyword { color: #8ae234; font-weight: bold; }
pre.oblivion_splender_theme span.comment { color: #729fcf; }
pre.oblivion_splender_theme span.string  { color: #fce94f; }
pre.oblivion_splender_theme span.char    { color: #ef2929; }
</style>
</head>
<body>

<h1>Default Theme</h1>

<pre class="code-csharp">
using System;

namespace Test.Javascript 
{
    private delegate string FooHandler&lt;T&gt;(T arg);

    public static class Main(string [] args)
    {
        // Here we dump the arguments
        foreach(string arg in args) {
            Console.WriteLine(@"You said: \"{0}\"", arg);
        }
        
        FoodHandler h = delegate &lt;string&gt;(string s) {
            Console.WriteLine("Here's another: \"" + s + "\""); // Single
        };
        
        /* Lalalal land.
           Another line.
           */
           
        h('k'.ToString());
        
        Console.WriteLine('\'');
    }
}
</pre>

<h1>Custom Theme</h1>

<pre class="code-javascript oblivion_splender_theme">
function highlight_elements (elements)
{
    for (var i = 0, n = elements.length; i &lt; n; i++) {
        var class_names = elements[i].className.split (" ");
        var theme = splender_theme;
        
        for (var j = 0, c = class_names.length; j &lt; c; j++) {
            if (class_names[j].match ("splender_theme")) {
                theme = eval (class_names[j]);
                break;
            }
        }
        
        for (var j = 0, c = class_names.length; j &lt; c; j++) {
            var splender_methods = splender_highlight_methods[class_names[j]];
            if (splender_methods != null) {
                splender_timer ("splender_highlight_element&lt;" + elements[i] + "&gt;", function () {
                    highlight_element (splender_methods, elements[i], theme);
                });
            }
        }
    }
}
</pre>

<h1>C Code</h1>

<pre class="code-c">
/* Testing a C multi-line comment
 * Another line.
 * And one more!
 */
 
#include &lt;stdio.h&gt;
#include "test.h"

// A single line comment

typedef struct __happy_days {
    gpointer p;
    union x {
        gint a;
        guint64 b;
    };
} happy_days;

#ifdef   poppy
#  undef poppy
#endif

// Here's a multi-line preprocessor directive

#define poppy (x) { \
    blah_blah (x);  \
}

gint main(gint argc, gchar **argv)
{
    #ifdef poppy
    while (1) {
        printf ("This nippet makes \"no\" sense!\n");
    }
    #endif
    
    exit (0);
}

</pre>



</body>
</html>

